package string;

public class SubStringDemo {
    public static void main(String[] args) {
        String name = "www.baidu.com";
        int stare = name.indexOf(".")+1;
        int end=name.lastIndexOf(".");
        String q=name.substring(stare,end);
        System.out.println(q);
    }
}
